home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_Eval.man < prev    next >
Encoding:
Text File  |  1990-06-21  |  6.2 KB  |  135 lines

  1.  
  2.  
  3.  
  4. Tcl_Eval          Tcl Command Language Library           Tcl_Eval
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_Eval - execute a Tcl command string
  12.  
  13. SSYYNNOOPPSSIISS
  14.      ##iinncclluuddee <<ttccll..hh>>
  15.  
  16.      int
  17.      TTccll__EEvvaall(_i_n_t_e_r_p, _c_m_d, _f_l_a_g_s, _t_e_r_m_P_t_r)
  18.  
  19. AARRGGUUMMEENNTTSS
  20.      Tcl_Interp   *_i_n_t_e_r_p      (in)      Interpreter in which  to
  21.                                          execute   the   command.
  22.                                          String  result  will  be
  23.                                          stored     in    _i_n_t_e_r_p-
  24.                                          >_r_e_s_u_l_t.
  25.  
  26.      char         *_c_m_d         (in)      Command (or sequence  of
  27.                                          commands) to execute.
  28.  
  29.      char         _f_l_a_g_s        (in)      Either  TTCCLL__BBRRAACCKKEETT__TTEERRMM
  30.                                          or   0.    If   0,  then  |
  31.                                          TTccll__EEvvaall  will   process  |
  32.                                          commands  from _c_m_d until  |
  33.                                          it  reaches   the   null  |
  34.                                          character  at the end of  |
  35.                                          the  string;    newlines  |
  36.                                          will  be treated as com-  |
  37.                                          mand   separators.    If  |
  38.                                          TTCCLL__BBRRAACCKKEETT__TTEERRMM,   then  |
  39.                                          TTccll__EEvvaall  will   process  |
  40.                                          comands  from  _c_m_d until  |
  41.                                          either it reaches a null  |
  42.                                          character      or     it  |
  43.                                          encounters    a    close  |
  44.                                          bracket    that    isn't  |
  45.                                          backslashed or  enclosed  |
  46.                                          in   braces,   at  which  |
  47.                                          point  it  will  return;  |
  48.                                          newlines will treated as  |
  49.                                          white space, not as com-  |
  50.                                          mand  separators.  Under  |
  51.                                          normal conditions, _f_l_a_g_s  |
  52.                                          should be 0.
  53.  
  54.      char         **_t_e_r_m_P_t_r    (out)     If _t_e_r_m_P_t_r is  non-NULL,  |
  55.                                          TTccll__EEvvaall     fills    in  |
  56.                                          *_t_e_r_m_P_t_r    with     the  |
  57.                                          address of the character  |
  58.                                          just after the last  one  |
  59.                                          in   the   last  command  |
  60.  
  61.  
  62.  
  63. Sprite v.1.0         Printed:  June 21, 1990                    1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Tcl_Eval          Tcl Command Language Library           Tcl_Eval
  71.  
  72.  
  73.  
  74.                                          successfully    executed  |
  75.                                          (normally the null char-  |
  76.                                          acter  at  the  end   of  |
  77.                                          _c_m_d).    If   an   error  |
  78.                                          occurs in the first com-  |
  79.                                          mand    in   _c_m_d,   then  |
  80.                                          *_t_e_r_m_P_t_r will be set  to  |
  81.                                          _c_m_d.
  82.  
  83. _________________________________________________________________
  84.  
  85.  
  86. DDEESSCCRRIIPPTTIIOONN
  87.      TTccll__EEvvaall parses commands from _c_m_d and executes them in order
  88.      until either an error occurs or TTccll__EEvvaall reaches a terminat-
  89.      ing character (']' or ' ', depending on the value of _f_l_a_g_s).
  90.      The  return  value  from  TTccll__EEvvaall  is one of the Tcl return
  91.      codes   TTCCLL__OOKK,   TTCCLL__EERRRROORR,   TTCCLL__RREETTUURRNN,   TTCCLL__BBRREEAAKK,   or
  92.      TTCCLL__CCOONNTTIINNUUEE, and _i_n_t_e_r_p->_r_e_s_u_l_t will point to a string with
  93.      additional information  (result  value  or  error  message).
  94.      This return information corresponds to the last command exe-
  95.      cuted from _c_m_d.
  96.  
  97.      During the processing of a  command  it  is  legal  to  make
  98.      nested  calls  to TTccll__EEvvaall (this is how conditionals, loops,
  99.      and procedures are  implemented).   If  a  code  other  than
  100.      TTCCLL__OOKK  is  returned from a nested TTccll__EEvvaall invocation, then
  101.      the caller should normally return immediately, passing  that
  102.      same  return  code  back  to its caller, and so on until the
  103.      top-level application is reached.  A few commands, like ffoorr,
  104.      will  check  for  certain  return  codes, like TTCCLL__BBRREEAAKK and
  105.      TTCCLL__CCOONNTTIINNUUEE, and process them specially without returning.
  106.  
  107.      TTccll__EEvvaall keeps track of how many nested Tcl_Eval invocations
  108.      are  in  progress  for  _i_n_t_e_r_p.   If  a  code of TTCCLL__RREETTUURRNN,
  109.      TTCCLL__BBRREEAAKK, or TTCCLL__CCOONNTTIINNUUEE is about to be returned from  the
  110.      topmost  TTccll__EEvvaall  invocation for _i_n_t_e_r_p, then TTccll__EEvvaall con-
  111.      verts the return code to TTCCLL__EERRRROORR and  sets  _i_n_t_e_r_p->_r_e_s_u_l_t
  112.      to  point  to  an  error message indicating that the rreettuurrnn,
  113.      bbrreeaakk, or ccoonnttiinnuuee command was invoked in  an  inappropriate
  114.      place.   This means that top-level applications should never
  115.      see a  return  code  from  TTccll__EEvvaall  other  then  TTCCLL__OOKK  or
  116.      TTCCLL__EERRRROORR.
  117.  
  118.  
  119. KKEEYYWWOORRDDSS
  120.      command, execute, interpreter
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0         Printed:  June 21, 1990                    2
  132.  
  133.  
  134.  
  135.